Skip to main content

Fleet Operations Customer Contract Import

Introduction​

This will import Fleet Operations vehicles in to ViSN, and allocate vehicles to sub-customers using the Customer Account Number field

download sample Fleet Operations customer contract import file.

File format​

Comma Separated Values - *.csv
Encoding - UTF-8

Fleet Operations Customer Customers Import​

Sr. no.Fields in Fleet Operations FileMap to ViSN customer-contractDescriptionMax lengthRules / ValidationMandatoryExample
ARegistrationREGISTRATIONREGISTRATION10A-Z & 0-9YAM10JKL
BVINVINVIN20[A-Z] [0-9] and special characters - Standard VIN FormatNWVWZZZ1KZAM10JKL1
CAsset NumberASSET NUMBERASSET NUMBER10A-Z & 0-9NASSET003
DRegistration DateREGISTRATION DATEREGISTRATION DATE10[0-9] ddmmyyyyN15062023
EMakeMAKEMAKE50A-Z & 0-9 and Special CharactersNVolkswagen
FModelMODELMODEL50A-Z & 0-9 and Special CharactersNGolf
GSpecificationSpecificationString100A-Z & 0-9, spaces, dash, hyphen and special charactersNMatch
HFuel TypeFuel TypeFuel Type50All Characters and Special CharactersNDiesel
IVehicle TypeVehicle TypeVehicle Type10A-Z & 0-9 and special charactersYCar
JContract Start DateCONTRACT START DATECONTRACT START DATE10[0-9] ddmmyyyyN15062023
KContract End DateCONTRACT END DATECONTRACT END DATE10[0-9] ddmmyyyyN15062026
LContract Mileage TermMILEAGEMileage60-9N20000
MCAPIDCAP IDCAP ID20[A-Z] [0-9] and Special CharactersNCAPID003
NArgic CodeArgic CodeString20A-Z & 0-9, spaces and special charactersNARGIC03
OColourCOLOURCOLOUR200A-Z & 0-9 and Special CharactersNGrey
PMOT Due DateMOT DUE DATEMOT DUE DATE10[0-9] ddmmyyyyN15062027
QMaintainedMaintainedManaged / non-managedN/Atrue / falseYtrue
RVehicle ProductVehicle ProductFleet Managed50A-Z & 0-9 and Special CharactersNFleet Managed
SService ScheduleService ScheduleService Schedule8[0-9]N24000
TWarranty Parameter MonthsWarranty Parameter MonthsNumber3[0-9]N48
UWarranty Parameter MileageWARRANTY MILEAGEWARRANTY MILEAGE6[0-9]N85000
VFridgeFridgeString1Y or NNN
WTail LiftTail LiftString1Y or NNN
XCraneCraneString1Y or NNN
YCustomer NameCustomer NameString100a-zA-Z0-9, -, ' and Special CharactersNFord cust
ZCustomer Account NumberCustomer Account NumberString50A-Z, 0-9 and All Special CharactersN00123456789
AAVAT NumberVAT NumberVAT Number15A-Z, 0-9 and All Special CharactersNGB987654321
ABAddress 1Building NumberBuilding Number50A-Z, 0-9 and All Special CharactersN45
ACAddress 2Street NameStreet Name100A-Z, 0-9 and All Special CharactersNChurch Road
ADAddress 3DistrictDistrict50A-Z, 0-9 and All Special CharactersNNorth
AEAddress 4TownTown100A-Z, 0-9 and All Special CharactersNManchester
AFAddress 5CountyCounty50A-Z, 0-9 and All Special CharactersNGreater Manchester
AGPostcodePostcodePostcode15[a-zA-Z0-9]NM11AA
AHSMRSMRString1Y or NNY
AITyresTyresString1Y or NNY
AJGlassGlassString1Y or NNY
AKAccident ManagementAccident ManagementString1Y or NNN
ALBreakdownBreakdownString1Y or NNY
AMInsuranceInsuranceString1Y or NNN
ANRentalRentalString1Y or NNN
AOCost CentreCost CentreString100A-Z, a-z, 0-9 and permitted special charactersNCC003
APInvoice CentreInvoice CentreString15A-Z, a-z, 0-9 and permitted special charactersNINV003
AQCustomer ContactContact NumberContact Number150-9N07987654321
ARCustomer NumberCustomer NumberString150-9N00123456789
ASCustomer EmailCustomer EmailString50Standard Email FormatNops@example.com
ATCustomer Policy NotesCustomer Policy NotesString700A-Z & 0-9, spaces, dash, hyphen and special charactersNPolicy notes text
AUCustomer Recharge LimitCustomer Recharge LimitNumber—[0-9]N300
AVCustomer Referral LimitCustomer Referral LimitNumber—[0-9]N600
AWDriver FirstnameDriver first nameString30A-Z & 0-9 and Special CharactersNSimon
AXDriver LastnameDriver Last nameString30A-Z & 0-9 and Special CharactersNRouse
AYDriver EmailDriver EmailString50Standard Email FormatNsimon.d@example.com
AZDriver NumberDriver NumberNumber11[0-9] Standard Mobile Phone FormatN07987654321
BAPolicy NumberPolicy NumberString25A-Z & 0-9, spaces, dash and hyphenNPOL-FO003
BBPolicy Start DatePolicy Start DateString10[0-9] ddmmyyyyN15062023
BCPolicy End DatePolicy End DateString10[0-9] ddmmyyyyN15062026
BDPolicy TermPolicy TermNumber—[0-9]N36
BEProduct TypeProduct TypeString20A-Z, a-z, 0-9 and all special charactersNWR91OJ
BFVehicle BudgetVehicle BudgetDecimal100-9 and decimal valuesN1500.50
BGSpend to DateSpend To DateDecimal100-9 and decimal valuesN250.75
BHMOT ClassMOT ClassString100A-Z, a-z, 0-9 and all special charactersNClass 4

Importing a File​

Preparation​

  1. Create a new branch including the Jira task number in the branch name.
  2. Delete all files in the importFiles folder.
  3. Create a folder with the current sprint number.
  4. Copy the file that needs to be imported to the created folder.
  5. Update package.json:
    • Locate the line for validate:fleetOperationsCustomerContract.
    • Update --leaseId with the required lease ID.
    • Update --file with the relative path of the file.
  6. Save package.json.

Local Validation​

  1. In a terminal, run npm run build.
  2. Run the validation script: npm run validate:fleetOperationsCustomerContract.
  3. If validation passes without errors, push the code.

Workflow Validation​

  1. Navigate to Actions in the Import Manager.
  2. Locate <Environment> - on-demand-import.
  3. Select the branch created for this import.
  4. Enter the script name as validate:fleetOperationsCustomerContract.
  5. Leave the Overrides field empty.

Importing the File​

  1. If the validation passes, proceed with the import.
  2. Navigate to Actions in the Import Manager.
  3. Locate <Environment> - on-demand-import.
  4. Select the branch created for this import.
  5. Enter the script name as import:fleetOperationsCustomerContract.
  6. Enter --persist in the Overrides field (or --leaseId <leaseId> --persist when a specific lease is required).

Importing the File via Cloud Run​

Validation scheduler setup​

  1. Go to Cloud Scheduler and select CREATE JOB.
  2. Configure the Cloud Scheduler with the following parameters:
  • Name: fleet_operations_customer_contract_import_file_validation
  • Region: europe-west2
  • Frequency: 0 0 31 12 1
  • Time Zone: British Summer Time (BST)
  • Target Type: HTTP
  • URL: https://import-manager-36r2bu4izq-uc.a.run.app/fleet-operations-customer-contract
  • HTTP Method: POST
  • Auth Header: Select OIDC Token
  • Service Account: cloud-run-import-customer-contract
  • Body: Include the following JSON object:
{
"leaseId": "QJKgdjS4I02sEia4yTne",
"leaseCompanyName": "Next Fleet Services",
"persist": "false",
"bucket": "biddirect-2.appspot.com",
"appDirectory": "/usr/src/app/",
"importPath": "imports/fileDrop/",
"importFileDropPath": "imports/fileDrop/",
"importFileName": "fleetOperationsCustomerContract.csv",
"email": "mailgun@digitalinnk.com",
"fatalErrorEmailToAddress": "mailgun@digitalinnk.com",
"schema": "FLEET_OPERATIONS_CUSTOMER_CONTRACT",
"locale": "en_GB"
}

Import scheduler setup​

  1. Go to Cloud Scheduler and select CREATE JOB.
  2. Configure the Cloud Scheduler with the following parameters:
  • Name: fleet_operations_customer_contract_import
  • Region: europe-west2
  • Frequency: 0 0 31 12 1
  • Time Zone: GMT London
  • Target Type: HTTP
  • URL: https://import-manager-36r2bu4izq-uc.a.run.app/fleet-operations-customer-contract
  • HTTP Method: POST
  • Auth Header: Select OIDC Token
  • Service Account: cloud-run-import-customer-contract
  • Body: Include the following JSON object:
{
"leaseId": "QJKgdjS4I02sEia4yTne",
"leaseCompanyName": "Next Fleet Services",
"persist": "true",
"bucket": "biddirect-2.appspot.com",
"appDirectory": "/usr/src/app/",
"importPath": "imports/fileDrop/",
"importFileDropPath": "imports/fileDrop/",
"importFileName": "fleetOperationsCustomerContract.csv",
"email": "mailgun@digitalinnk.com",
"fatalErrorEmailToAddress": "mailgun@digitalinnk.com",
"schema": "FLEET_OPERATIONS_CUSTOMER_CONTRACT",
"locale": "en_GB"
}

Preparation​

  1. Bucket Name: biddirect-2.appspot.com (bucket name may vary across environments).
  2. File Path: Place the file in imports/fileDrop within the bucket, using the CSV file named fleetOperationsCustomerContract.csv.

Running validation​

  1. Go to Cloud Scheduler.
  2. Run the fleet_operations_customer_contract_import_file_validation job (job name may vary in different environments).

Running import​

  1. Go to Cloud Scheduler.
  2. Run the fleet_operations_customer_contract_import job (job name may vary in different environments).

Testing​

  1. After running the import, verify that Fleet Operations vehicles have been successfully imported by navigating to the ViSN customer platform.
  2. Go to Vehicle Record and search for the imported vehicle to confirm the import process was successful.
  3. Where Customer Account Number is provided, verify the vehicle is allocated to the matching sub-customer, or that a new sub-customer has been created.
Status: Pending Approval
Category: Protected
Authored By: Vishali on Sep 18, 2026
Revisions